package com.jy.adscm.spss.controller;


import com.jy.adscm.spss.bean.Base_incomeexpenditure;
import com.jy.adscm.spss.bean.SalePurchase;
import com.jy.adscm.spss.service.Base_commodityinfoService;
import com.jy.adscm.spss.service.Base_incomeexpenditureService;
import com.jy.adscm.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yyy
 * @since 2018-11-08
 */
@RestController
@RequestMapping("/base_commodityinfo/Sale")
public class Base_commodityinfoController {
    @Autowired
    Base_commodityinfoService base_commodityinfoService;

    @Autowired
    Base_incomeexpenditureService base_incomeexpenditureService;

    /**
     * 根据任务类型查询销售采购总金额
     * @param rwlx
     * @return
     * @throws Exception
     */

    @RequestMapping("/queryPlan")
    public SimpleCoreResponse queryProduction(String rwlx) throws Exception {
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService.loadPlanTotal(rwlx));
    }

    @RequestMapping("/queryPlanTotal")
    public SimpleCoreResponse queryPlanTotal(){
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService.queryPlanTotal());
    }

    @RequestMapping("/getStackingChart")
    public SimpleCoreResponse getStackingChart(String type){
        return new SimpleCoreResponse("200","查询采购",base_commodityinfoService.getStackingChart(type));
    }
    @RequestMapping("/queryBySZInformation")
    public SimpleCoreResponse qurtyBySZInformation(String szlx,String whereWeek){
        return new SimpleCoreResponse("200","查询成功",base_incomeexpenditureService.loadBySZInformation(szlx,whereWeek));
    }
    @RequestMapping("/getDetailed")
    public SimpleCoreResponse getDetailed(String whereWeek,String rwlx){
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService.getByDetailed(whereWeek,rwlx));
    }
    @RequestMapping("/getSZDtail")
    public SimpleCoreResponse getSZDtail() throws Exception{
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService.getSZDtail());
    }
    @RequestMapping("/updateXSTable")
    public SimpleCoreResponse updateXSTable(SalePurchase salePurchase){
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService);
    }

    @RequestMapping("/getIncomeStacking")
    public SimpleCoreResponse getIncomeStacking(String rwlx){
        return new SimpleCoreResponse("200","查询成功",base_commodityinfoService.getIncomeStacking(rwlx));
    }
}

